Skip to content

Conversation

@rascmatt
Copy link
Contributor

@rascmatt rascmatt commented Nov 9, 2025

Changes introduced within this PR:

  • Extend the IPG with a RtlDecodeTreeNode, to represent the decoder in the RTL IPG + Behavior graphs
  • Extract the control signals decided/decoded by the decode tree based on instruction context in the IPG
  • Optionally emit the VDT or a truth-table based decoder
  • Introduce a new CLI option rtl-table to optionally select table-based decoder

@rascmatt rascmatt self-assigned this Nov 9, 2025
@rascmatt rascmatt requested a review from linushdot November 9, 2025 09:22
@github-actions github-actions bot added enhancement New feature or request hardware Related to the MiA and hardware generation labels Nov 9, 2025
@rascmatt rascmatt requested a review from Jozott00 November 9, 2025 09:22
@rascmatt rascmatt marked this pull request as ready for review November 9, 2025 09:23
Copy link
Contributor

@Jozott00 Jozott00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rascmatt
Copy link
Contributor Author

rascmatt commented Nov 16, 2025

I implemented some additions/improvements discussed with @linushdot this week:

  • improve structure of the HDL decode tree by moving default assignments to the top
  • Use wildcards in the rtl-table output patterns
  • for now use big-endian byte order to be compatible with the existing RTL description
  • Always decode/match all ISA instructions, even if no output signal depends on them (as we don't want to fall back to 'invalid' in this case)
  • Fix/run the test suite (locally) with all 3 decoder versions and the rv32im spec.

Imho this is ready to merge now. Next steps should be to integrate the Risc-V Suite + an Analysis/Evaluation Pipeline into our existing automated Docker-Based tests runners.

Copy link
Contributor

@linushdot linushdot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me as well.

I confirmed that the test suite works on rv32i with the different versions of the decoder in it.

I also tried to prove equivalence of the decoders with Yosys. The new decoders are equivalent. But I ran into difficulties comparing the new decoders to the old implementation. We can very likely disregard that, since the new decoders pass the test suite as well and provider better implementations for the decoder. Or it even means that old decoder was not correct.

- Implement generator to represent the decision
  logic of the decode tree as a Chisel module
- For fixed-length, non-overlapping instruction sets,
  we may use Chisel's truth/decoder table with circuit
  optimizations to generate a decoder
- add decoder option for the RTL table based
  decoder

- improve the RTL template formatting
- improve structure of the hdl decision tree
  by moving default assignments to the top
- for now use big-endian byte order to be compatible
  with the existing RTL description
- Always decode/match all ISA instructions, even if
  no output signal depends on them (as we don't want
  to fall back to 'invalid' in this case)
- Fix/run the test suite (locally) with all 3 decoder
  versions and the rv43im spec.
- Use wildcards in the rtl-table output patterns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request hardware Related to the MiA and hardware generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants